﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Web.Mvc;

namespace StarterKits.Mvc.Filters.FormsAuthentication
{
	/// <summary>
	/// Based on code originally published by Rob Conery:
	/// http://blog.wekeroad.com/blog/aspnet-mvc-securing-your-controller-actions/
	/// </summary>
	public class RequiresAnonymousAttribute : BaseAuthenticationAttribute
	{
		protected override bool IsValid( ActionExecutingContext filterContext )
		{
			return !filterContext.HttpContext.User.Identity.IsAuthenticated;
		}
	}
}
